/**
 * Created by Wenwu on 10/27/2016.
 * 公共js，每个页面都需要执行
 */
define(function (require) {
    if (typeof sessionStorage.userInfo !== 'undefined') {
        var userInfo = JSON.parse(decodeURIComponent(atob(sessionStorage.userInfo)));
        var el = document.querySelector('.footer > a:last-child');
        if (userInfo.member.msg != 0  || userInfo.member.greeted != 0 ||userInfo.member.inbox != 0) {
            var node = document.createElement("span");
            var textnode = document.createTextNode(parseInt(userInfo.member.msg)+parseInt(userInfo.member.greeted)+parseInt(userInfo.member.inbox));
            node.appendChild(textnode);
            el.appendChild(node);
        }
    }
});